/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.view;

import com.model.Anggota;
import java.awt.BorderLayout;
import java.util.ArrayList;
import javax.swing.*;

/**
 *
 * @author winda
 */
public class PanelLihatTabelAnggota extends JPanel {

    private JTable tabelAnggota;
    private JLabel labelPanel;
    private ArrayList<Anggota> data;

    public PanelLihatTabelAnggota(ArrayList<Anggota> data) {
        this.data = data;
        setLayout(new BorderLayout());
        labelPanel = new JLabel("Form Lihat Anggota");
        labelPanel.setHorizontalAlignment(JLabel.CENTER);
        add(labelPanel, BorderLayout.NORTH);
        tabelAnggota = new JTable();
        tabelAnggota.setModel(new AnggotaTabelModel(data));
        add(tabelAnggota, BorderLayout.CENTER);
    }

    public ArrayList<Anggota> getData() {
        return data;
    }

    public void setData(ArrayList<Anggota> data) {
        this.data = data;
    }
}



